package com.aube.interact.model;

import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by huyaonan on 16/4/19.
 */
public class GoodsRoute implements Serializable {
    public int s;
    public float X;
    public float Y;

    public float[] get() {
        return new float[]{X, Y};
    }

    public static GoodsRoute parse(JSONObject jsonObject) {
        if(jsonObject == null)
            return new GoodsRoute();
        GoodsRoute route = new GoodsRoute();
        route.s = jsonObject.optInt("s");
        route.X = (float) jsonObject.optDouble("X");
        route.Y = (float) jsonObject.optDouble("Y");
        return route;
    }

}
